﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FlatRedBall;
using FlatRedBall.Math.Geometry;

using ROMAP.Utilities;
using FlatRedBall.Graphics.Animation;

namespace ROMAP.Entities.Tiles
{
    public class Electricity : Tile
    {
        private const int NUM_FRAMES = 4;

        public Electricity(int x, int y, float rotation)
        {
            this.TilePosition = new Vector2i(x, y);
            Initialize();

            this.RotationZ = rotation;
        }

        protected override void Initialize()
        {
            _sprite = SpriteManager.AddSprite(CreateSprite());
            _sprite.PixelScale();
            _sprite.AttachTo(this, false);
            _sprite.Animate = true;
            _sprite.CurrentFrameIndex = 0;

            base.Initialize();

            _collision.ScaleY *= .5f;
        }

        protected AnimationChainList CreateSprite()
        {
            AnimationChainList ani = new AnimationChainList();
            AnimationChain chain = new AnimationChain();

            for (int i = 1; i <= NUM_FRAMES; i++)
            {
                chain.Add(new AnimationFrame(@"Content/Obstacles/ElectricityField/" + i, 0.06f, "Global"));
            }

            ani.Add(chain);

            return ani;
        }

        public override void Activity()
        {
            throw new NotImplementedException();
        }
    }
}
